<?php

namespace App\Http\Controllers;

use App\Models\GrUserComment;
use App\service\ReturnService;
use Illuminate\Http\Request;

class CommentController extends Controller
{
    /**
     * 获取商品评论
     */
    public function get_goods_comment(Request $request){
        $goods_id=$request->get('goods_id');
        $data=GrUserComment::where('goods_id',$goods_id)->get()->toArray();
        foreach ($data as $k=>$v){
            $data[$k]['comment_img']=json_decode($v['comment_img']);
        }
        return ReturnService::successReturn('200','成功',$data);
    }
}
